<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>04 样式</title>
  <style>
    .test {
      font-size: 50px;
    }
    .a {
      color: white;
    }
    .b {
      background-color: red;
    }
  </style>
</head>
<body>
  <div id="app">
    <div style="color: red">测试</div>
    <!-- 对象写法 -->
    <div :class="{ test: isActive }">测试</div>
    <div :class="isActive ? 'test' : ''">测试</div>
    <!-- 数组写法 -->
    <div class="a b">测试</div>
    <div :class="[ aa, bb ]">测试</div>
  </div>
</body>
<script src="lib/vue.js"></script>
<script>
  new Vue({
    data: {
      isActive: true,
      aa: {
        a: false
      },
      bb: {
        b: true
      }
    }
  }).$mount('#app')
</script>
</html>